package com.hadwinling.dao;


import com.hadwinling.entity.Favor;

import java.util.List;

public interface FavorGoodMapper {

    /**
     * 用户对某种商品的收藏
     * @param uid 用户的id
     * @param goodid    商品id
     * @return
     */
    public int addCollectionByUidAndGoodid(int uid, int goodid);


    /**
     * 根据用户id查询我的收藏信息
     * @param uid 用户id
     * @return
     */
    public List<Favor> findMyFavorByUid(int uid);

    /**
     * 查询该帖子是否已经被该用户收藏过
     * @param uid   用户id
     * @param goodid    商品id
     * @return
     */
    public Favor selectIfCollection(int uid, int goodid);


    /**
     * 用户对商品取消收藏
     * @param uid 用户id
     * @param goodid    商品id
     * @return
     */
    public int deleteCollectionByUidAndGoodid(int uid, int goodid);

}
